from typing import Optional
from datetime import datetime
from pydantic import BaseModel

class VehicleRentalBase(BaseModel):
    work_area_id: int = -1
    package_order_id: int = -1
    package_order_title: Optional[str] = None
    vehicle_type: str
    vehicle_count: int
    rental_start_date: datetime
    rental_end_date: datetime
    days: int
    daily_rate: float
    total_amount: float
    currency: str = "HKD"
    driver_included: bool = True
    notes: Optional[str] = None

class VehicleRentalCreate(VehicleRentalBase):
    pass

class VehicleRentalUpdate(BaseModel):
    package_order_id: Optional[int] = None
    package_order_title: Optional[str] = None
    vehicle_type: Optional[str] = None
    vehicle_count: Optional[int] = None
    rental_start_date: Optional[datetime] = None
    rental_end_date: Optional[datetime] = None
    days: Optional[int] = None
    daily_rate: Optional[float] = None
    total_amount: Optional[float] = None
    currency: Optional[str] = None
    driver_included: Optional[bool] = None
    notes: Optional[str] = None

class VehicleRental(VehicleRentalBase):
    ID: int

    class Config:
        from_attributes = True 